<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app"></div>

    <script src="./vue3.js"></script>
    <script>
      // let app = new Vue({
      //   el: "#app",
      //   data: {
      //     users: [],
      //   },
      // });

      // <div v-if="users.length">
      //   <div v-for="user,index in users" :key="index"></div>
      // </div>

      let app = Vue.createApp({
        data() {
          return {
            users: [],
          };
        },
        template: `
          <div v-if="users.length" v-for="user,index in users" :key="index"></div>
        `,
      });

      app.mount("#app");

      function render(_ctx, _cache) {
        with (_ctx) {
          const {
            renderList: _renderList,
            Fragment: _Fragment,
            openBlock: _openBlock,
            createElementBlock: _createElementBlock,
            createCommentVNode: _createCommentVNode,
          } = _Vue;

          return users.length
            ? (_openBlock(true),
              _createElementBlock(
                _Fragment,
                { key: 0 },
                _renderList(users, (user, index) => {
                  return (
                    _openBlock(), _createElementBlock("div", { key: index })
                  );
                }),
                128 /* KEYED_FRAGMENT */
              ))
            : _createCommentVNode("v-if", true);
        }
      }
    </script>
  </body>
</html>
